#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#include<string.h>


void Test2()
{
	string s1 = "0123456789jqk";
	cout << s1.size() << endl;
	cout << s1.capacity() << endl;
	
	s1.resize(5);
	cout << s1 << endl;
	cout << s1.capacity() << endl;

	s1.resize(10, 'x');
	cout << s1 << endl;
	cout << s1.capacity() << endl;

	//s1.reserve(100);
	//cout << s1.capacity() << endl;
}

void Test1()
{
	string s1 = "hello world";
	cout << s1 << endl;
	string s2 = s1;
	string s3 = "";
	s1 = "";
	int ret = (s1.c_str() == s3.c_str());

	cout << ret << endl;
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;

	/*const char* ret = s1.c_str();*/
}

void Test3()
{
	string s = "hello world";
	cout << s.size() << endl;
	cout << s.capacity() << endl;
	s.resize(50);
	cout << s << endl;
	cout << s.size() << endl;
	cout << s.capacity() << endl;

	s.shrink_to_fit();
	cout << s << endl;

	cout << s.size() << endl;
	cout << s.capacity() << endl;

}

void Test4()
{
	string s = "012345x789";
	//cout << s.at(6) << endl;

	//s.replace(4, 5, "hello");
	//cout << s << endl;

	char* ret = new char[10]{'\0'};
	s.copy(ret, 5,0);
	cout << ret << endl;
		
}

int main()
{
	Test4();

	return 0;
}

